#include <stdio.h>
#include <stdlib.h>

void MoveStr(char* s, int l, int r, int k)
{
    int len = r - l + 1;
    k = k % 26;
    for (int i = l; i <= r; i++)
    {
        int NewChar = ((s[i - 1] - 'a' + k) % 26) + 'a';
        s[i - 1] = (char)NewChar;
    }
}

int main(int argc, char* argv[])
{
    int l = 1, r = 1, k = 1;
    int N = 1, Q = 1;
    scanf("%d %d", &N, &Q);
    char* S = (char*)malloc(sizeof(char) * (N + 1));
    scanf("%s", S);

    while (Q--)
    {
        scanf("%d %d %d", &l, &r, &k);
        MoveStr(S, l, r, k);
    }

    printf("%s\n", S);


    return 0;
}